<div class="container page-container" id="event-details">
    <div class="page-header">
        <h2><span class="glyphicon glyphicon-glass"></span> Event</h2>
    </div>
    <div class="row" style="padding-left: 1em;padding-bottom: 1em;">
        <div class="list-group col-md-2">
            <?php 
                $now = new DateTime(); 
                $mon = $now->format('m');
                $year = $now->format('Y');
                $eve = explode('-', $this->session->userdata('eve_priv'));
                $res = explode('-', $this->session->userdata('res_priv'));
                $con = explode('-', $this->session->userdata('con_priv'));
                echo '<a href="'.site_url().'events/calendar/'.$year.'/'.$mon.'" class="list-group-item">'.
                        '<span class="glyphicon glyphicon-calendar"></span> Events Calendar</a>';
                //echo '<a href="" class="list-group-item"><span class="glyphicon glyphicon-list-alt"></span> Events List</a>';
                if($eve[0]==0){
                    echo '<a class="list-group-item active"><span class="glyphicon glyphicon-plus"></span> Create Event</a>';
                }
            ?>
        </div>
        <div class="create-event-wrapper col-md-10">
            <?php if($eve[0]==0){ ?>
            <ul class="nav nav-tabs nav-pills nav-justified" id="create-event-nav">
                <li class="event-details-nav active"><a data-target="#event-details-tab">Event Detail</a></li>
                <li class="event-supplier-nav"><a data-target="#event-supplier-tab">Event Supplier</a></li>
                <li class="event-checklist-nav"><a data-target="#event-checklist-tab">Event Checklist</a></li>
                <li class="event-task-nav"><a data-target="#event-task-tab">Event Task</a></li>
            </ul>
            <div class="tab-content create-event-container">
                <!--Event Details-->
                <div class="tab-pane active" id="event-details-tab">
                    <form id="event-details-form" method="post">
                        <div class="form-group">
                            <div class="row">
                                <div class="col-md-4">
                                    <label>Project Start Date: </label>
                                    <div class="form-inline">
                                        <input type="text" class="form-control start-date" name="start_date" placeholder="yyyy-dd-mm">
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <label>Project End Date: </label>
                                    <div class="form-inline">
                                        <input type="text" class="form-control end-date" name="end_date" placeholder="yyyy-dd-mm">
                                    </div>
                                </div>
                                <div class="col-md-4">	
                                    <label>Event Budget:</label>
                                    <input type="text" class="form-control event-budget" name="event_budget">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="row">
                                <div class="col-md-7">
                                    <label>Event Name</label>
                                    <input type="text" name="event_name" class="form-control event-name">
                                </div>
                                <div class="col-md-5">
                                    <label>Event Type: 
                                        <?php if($res[0]==0){?>
                                        <a href="#e-d-new-event-type-popup" data-backdrop="static" data-keyboard="false" data-toggle="modal">New event type</a>
                                        <?php } ?>
                                    </label>	
                                    <select class="form-control event-type-select required select" name="event_type">
                                        <option value="">Type</option>
                                        <?php foreach($event_types as $event_type): ?>
                                            <option value="<?php echo $event_type['type_id']?>"><?php echo $event_type['type_name']?></option>	
                                        <?php endforeach; ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">		
                            <div class="row">
                                <div class="col-md-5">	
                                    <label>Client Name: 
                                        <?php if($con[0]==0){?>
                                        <a href="#e-d-new-client-popup" data-backdrop="static" data-keyboard="false" data-toggle="modal"> New client</a>
                                        <?php } ?>
                                    </label>
                                    <select class="form-control client-select" name="client">
                                        <option value="">Client</option>	
                                        <?php foreach($clients as $client): ?>
                                            <option value="<?php echo $client['client_id']?>"><?php echo $client['name']?></option>
                                        <?php endforeach; ?>
                                    </select>
                                </div>
                                <div class="col-md-7">
                                    <div class="col-md-12">
                                        <label>Event Actual Date: </label>
                                    </div>
                                    <div class="form-inline">
                                        <div class="col-md-5">
                                            <input type="text" class="form-control actual-date" name="actual_date" placeholder="yyyy-mm-dd">
                                        </div>
                                        <div class="actual-time">
                                            <div class="form-group col-md-3">
                                                <select class="form-control a-hr required select" name="a_hr">
                                                    <option class="default-hr" value="">Hour</option>
                                                    <?php $a_hr = 1; while($a_hr!=25){  ?>
                                                        <?php if(strlen($a_hr)==1) { ?>
                                                            <option value="0<?php echo $a_hr?>">0<?php echo $a_hr?></option>
                                                        <?php }else{ ?>
                                                            <option value="<?php echo $a_hr?>"><?php echo $a_hr?></option>
                                                        <?php } ?>
                                                    <?php $a_hr++; }?>
                                                </select>
                                            </div>
                                            <div class="col-md-1 text-center">
                                                <label>:</label>
                                            </div>
                                            <div class="form-group col-md-3">
                                                <select class="form-control a-min required select" name="a_min">
                                                    <option class="default-min" value="">Minute</option>
                                                    <?php $a_min = 0; while($a_min!=60){  ?>
                                                        <?php if(strlen($a_min)==1) { ?>
                                                            <option value="0<?php echo $a_min?>">0<?php echo $a_min?></option>
                                                        <?php }else{ ?>
                                                            <option value="<?php echo $a_min?>"><?php echo $a_min?></option>
                                                        <?php }?>
                                                    <?php $a_min+=10; }?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>				
                        <div class="form-group">
                            <label>Event Location/s:
                                <?php if($res[0]==0){?>
                                <a href="#e-d-new-venue-popup" data-backdrop="static" data-keyboard="false" data-toggle="modal"> New venue</a>
                                <?php } ?>
                            </label>
                            <div class="panel panel-default">
                                <div class="panel-heading">Check the venue/s that you like</div>
                                <div class="panel-body venue-panel">
                                <?php if($event_venues!=FALSE){ ?>
                                    <?php foreach ($event_venues as $event_venue): ?>
                                    <label><input type="checkbox" class="venue-checkbox" value="<?php echo $event_venue['venue_id']; ?>" /> <?php echo $event_venue['venue_name']; ?></label>&nbsp;
                                    <?php endforeach; ?>
                                <?php }?>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label>Event Coordinator: 
                                <?php if($con[0]==0){?>
                                <a href="#e-d-new-coord-popup" data-backdrop="static" data-keyboard="false" data-toggle="modal"> New coordinator</a>
                                <?php } ?>
                            </label>
                            <select class="form-control coordinator-select required select" name="coordinator">
                                <option value="">Coordinator</option>	
                                <?php foreach($coords as $coord): ?>
                                <option value="<?php echo $coord['coordinator_id']?>"><?php echo $coord['name']?></option>
                                <?php endforeach;?>
                            </select>
                        </div>
                        <div class="form-group">
                            <label> Event Notes: </label>
                            <textarea class="form-control event-desc" rows="4" name="event-desc"></textarea>
                        </div>
                        <input type="submit" role="button" class="btn btn-primary pull-right btn-proceed-event-supplier" value="Proceed &rarr;">
                    </form>
                    <!--New Event Type Modal-->
                    <?php if($res[0]==0){?>
                    <div class="modal fade" id="e-d-new-event-type-popup" tabindex="-1" role="dialog" aria-labelledby="new-event-type" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="new-event-type">New Event Type</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="evmodal-eventent-type-form" method="post">
                                        <input type="hidden" name="action" id="n-venue-action" value="0">
                                        <div class="form-horizontal">
                                            <div class="form-group">
                                                <label for="n-venue-name" class="col-sm-3 control-label">Type Name</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control event-type-name" name="event_type_name">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="pull-right">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" role="button" class="btn btn-primary btn-save" value="Save" />
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <!--New Client Modal-->
                    <?php if($con[0]==0){?>
                    <div class="modal fade" id="e-d-new-client-popup" tabindex="-1" role="dialog" aria-labelledby="new-client" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="new-client">New Client</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="client-form" class="client-form" method="post">
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <label for="n-lname" class="control-label">Last Name</label>
                                                <input type="text" name="lname" class="form-control lname"/>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="n-fname" class="control-label">First Name</label>
                                                <input type="text" name="fname" class="form-control fname"/>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 address-container">
                                                <label for="n-address" class="control-label">Address <a class="add-a-row">Add Row</a></label>
                                                <input type="text" class="form-control address-text address-1" name="address_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control address-text address-2" name="address_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control address-text address-3" name="address_3">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 contact-no-container">
                                                <label for="n-contact-no" class="control-label">Contact No. <a class="add-c-row">Add Row</a></label>
                                                <input type="text" class="form-control contact-no-text contact-1" name="contact_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control contact-no-text contact-2" name="contact_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control contact-no-text contact-3" name="contact_3">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 email-container">
                                                <label for="n-email" class="control-label">Email Address <a class="add-e-row">Add Row</a></label>
                                                <input type="text" class="form-control email-text email-1" name="email_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control email-text email-2" name="email_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="pull-right margin-top">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" class="btn btn-primary btn-save" value="Save" />
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <!--New Venue Modal-->
                    <?php if($res[0]==0){?>
                    <div class="modal fade" id="e-d-new-venue-popup" tabindex="-1" role="dialog" aria-labelledby="new-venue" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="new-venue">New Venue</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="venue-form" method="post">
                                        <input type="hidden" name="action" id="n-venue-action" value="0">
                                        <div class="form-horizontal">
                                            <div class="form-group">
                                                <label for="n-venue-name" class="col-sm-3 control-label">Venue Name</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control venue-name" name="venue_name">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="venue-address" class="col-sm-3 control-label">Venue Address</label>
                                                <div class="col-sm-9">
                                                    <input type="text" class="form-control venue-address" name="venue_address">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="pull-right">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" class="btn btn-primary btn-save" value="Save" />
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <!--New Employee Modal-->
                    <?php if($con[0]==0){?>
                    <div class="modal fade" id="e-d-new-coord-popup" tabindex="-1" role="dialog" aria-labelledby="new-coord" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="new-coord">New Coordinator</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="emp-form" class="emp-form" method="post">
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <label for="n-lname" class="control-label">Last Name</label>
                                                <input type="text" name="lname" class="form-control lname" />
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="n-fname" class="control-label">First Name</label>
                                                <input type="text" name="fname" class="form-control fname" />
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <label for="n-mname" class="control-label">Middle Name</label>
                                                <input type="text" name="mname" class="form-control mname" />
                                            </div>
                                            <div class="col-sm-6">
                                                <label>Gender</label><br/>
                                                <div class="btn-group gender" data-toggle="buttons">
                                                    <label class="btn btn-default active">
                                                        <input type="radio" name="gender" value="0" checked>Male
                                                    </label>
                                                    <label class="btn btn-default">
                                                        <input type="radio" name="gender" value="1">Female
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <label for="n-bday" class="control-label">Birthday</label>
                                                <input type="date" class="form-control bday" name="bday" placeholder="mm/dd/yyyy">
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="n-date-emp" class="control-label">Date Employed</label>
                                                <input type="date" name="date_emp" class="form-control date-emp" placeholder="mm/dd/yyyy" />
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 address-container">
                                                <label for="n-address" class="control-label">Address <a class="add-a-row">Add Row</a></label>
                                                <input type="text" class="form-control address-text address-1" name="address_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control address-text address-2" name="address_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control address-text address-3" name="address_3">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 contact-no-container">
                                                <label for="n-contact-no" class="control-label">Contact No. <a class="add-c-row">Add Row</a></label>
                                                <input type="text" class="form-control contact-no-text contact-1" name="contact_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control contact-no-text contact-2" name="contact_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control contact-no-text contact-3" name="contact_3">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 email-container">
                                                <label for="n-email" class="control-label">Email Address <a class="add-e-row">Add Row</a></label>
                                                <input type="text" class="form-control email-text email-1" name="email_1">
                                                <div class="input-group hide">
                                                    <input type="text" class="form-control email-text email-2" name="email_2">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default btn-remove-row" type="button" title="Remove Row"><span class=" glyphicon glyphicon-remove"></span></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="pull-right margin-top">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" role="button" class="btn btn-primary btn-save" value="Save"/>
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                </div>
                <!--Event Supplier-->
                <div class="tab-pane" id="event-supplier-tab">
                    <?php if($con[0]==0){?>
                    <a href="#e-s-new-supplier-popup" class="btn btn-primary" data-toggle="modal" data-backdrop="static" data-keyboard="false"><span class="glyphicon glyphicon-plus"></span> New Supplier</a>
                    <?php } ?>
                    <div id="event-supplier-list">
                        <?php if($supplier != FALSE) { ?>
                            <?php foreach($supplier as $item): ?>
                                <div class="list-group" style="padding:1em;border: solid 1px #cccccc;">
                                    <h4 class="list-group-item-heading">Company Name: <?php echo $item['company']?></h4>
                                    <p class="list-group-item-text">Contact Person: <?php echo $item['contact_person']?></p>
                                    <p class="list-group-item-text">Available Services: <span class="available-services"><?php echo $item['services']?></span></p>
                                    <p class="list-group-item-text">Services chosen: <span class="services-chosen"></span></p>
                                    <div class="btn-group pull-right">
                                        <a href="#services-popup" data-toggle="modal" data-backdrop="static" data-keyboard="false" class="btn-assign-services" data-supplierid="<?php echo $item['supplier_id']?>">Services</a>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            <?php endforeach; ?>
                        <?php } ?>
                    </div>
                    <button class="btn btn-primary pull-left btn-back-event-details">&larr; Back</button>
                    <button class="btn btn-primary pull-right btn-proceed-event-checklist">Proceed &rarr;</button>
                    <!--Supplier services Modal-->
                    <div class="modal fade" id="services-popup" tabindex="-1" role="dialog" aria-labelledby="services" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="services">Services</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="services-form" class="row" method="post">
                                        <input type="hidden" id="supplier-id" />
                                        <div class="input-group col-md-6">
                                            <input type="text" class="form-control service-name" name="service" placeholder="New Services...">
                                            <span class="input-group-btn">
                                                <button type="submit" class="btn btn-default btn-new-service" title="Add new service"><span class="glyphicon glyphicon-plus"></span></button>
                                            </span>
                                       </div>
                                    </form>
                                    <div class="panel panel-default services-container">
                                        <div class="panel-body">

                                        </div>
                                    </div>
                                    <div class="pull-right">
                                        <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                        <button type="button" class="btn btn-primary btn-assign">Assign</button>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--New Supplier Modal-->
                    <?php if($con[0]==0){?>
                    <div class="modal fade" id="e-s-new-supplier-popup" tabindex="-1" role="dialog" aria-labelledby="new-supplier" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="new-supplier">New Supplier</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="supplier-form" class="supplier-form" method="post">
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <label for="n-company" class="control-label">Company Name</label>
                                                <input type="text" name="cname" class="form-control cname" />
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <label for="n-contact-person" class="control-label">Contact Person</label>
                                                <input type="text" name="contact_person" class="form-control contact-person" />
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 services-container">
                                                <label for="n-address" class="control-label">Services</label>
                                                <a href="#" class="another-services">Add row</a>
                                                <input type="text" class="form-control services-text services-1" name="services_1">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 address-container">
                                                <label for="n-address" class="control-label">Address</label>
                                                <input type="text" class="form-control address-text address-1" name="address_1">
                                                <input type="text" class="form-control address-text address-2" name="address_2">
                                                <input type="text" class="form-control address-text address-3" name="address_3">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 email-container">
                                                <label for="n-email" class="control-label">Email Address</label>
                                                <input type="text" class="form-control email-text email-1" name="email_1">
                                                <input type="text" class="form-control email-text email-2" name="email_2">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12 contact-no-container">
                                                <label for="n-contact-no" class="control-label">Contact No.</label>
                                                <input type="text" class="form-control contact-no-text contact-no-1" name="contact_no_1">
                                                <input type="text" class="form-control contact-no-text contact-no-2" name="contact_no_2">
                                                <input type="text" class="form-control contact-no-text contact-no-3" name="contact_no_3">
                                            </div>
                                        </div>
                                        <div class="pull-right margin-top">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" class="btn btn-primary btn-save" value="Save"/>
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                </div>
                <!--Event Checklist-->
                <div class="tab-pane" id="event-checklist-tab">
                    <div class="row" style="margin-bottom: 1em;">
                        <?php if($res[0]==0){?>
                        <div class="col-md-6">
                             <form id="category-form" method="post" class="form-inline new-category-form">
                                 <div class="input-group">
                                    <input type="text" class="form-control category-name required" name="category_name" placeholder="New Category...">
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-default btn-new-category" type="button"><span class="glyphicon glyphicon-plus"></span></button>
                                    </span>
                                </div>
                            </form>
                        </div>
                        <?php } ?>
                        <div class="col-md-1">
                            <button class="btn btn-primary btn-reset-event-checklist" type="button"><span class="glyphicon glyphicon-refresh"></span> Reset</button>
                        </div>
                    </div>
                    <div id="event-checklist-list">
                         <?php if($category != FALSE) { ?>
                            <?php foreach ($category as $item): ?>
                            <div class="panel panel-default">
                               <div class="panel-heading" data-catid="<?php echo $item['category_id']?>">
                                   <a class="show-sub-cat" title="Show sub category"><span class="glyphicon glyphicon-chevron-right"></span></a>
                                   <?php echo $item['category_name']?>
                                   <a class="remove-cat pull-right" title="Remove category"><span class="glyphicon glyphicon-remove"></span></a>
                               </div>
                            </div>
                            <?php endforeach; ?>
                         <?php } ?>
                    </div>
                    <button class="btn btn-primary pull-left btn-back-event-supplier">&larr; Back</button>
                    <button class="btn btn-primary pull-right btn-proceed-event-task">Proceed &rarr;</button>
                </div>
                <!--Event Task-->
                <div class="tab-pane" id="event-task-tab">
                    <div class="btn-group">
                        <a href="#add-event-task-popup" class="btn btn-primary" data-toggle="modal" data-backdrop="static" data-keyboard="false"><span class="glyphicon glyphicon-plus"></span> Add Task</a>
                    </div>
                    <div class="event-task-list" style="margin-bottom:1em;margin-top: 1em;">
                        
                        <div class="clearfix"></div>
                    </div>
                    <button class="btn btn-primary pull-left btn-back-event-checklist">&larr; Back</button>
                    <button class="btn btn-primary pull-right btn-finish">Finish &rarr;</button>
                    <!--New Event Task Modal-->
                    <div class="modal fade" id="add-event-task-popup" tabindex="-1" role="dialog" aria-labelledby="add-event-task" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="add-event-task">Add Event Task</h4>
                                </div>
                                <div class="modal-body">
                                    <form id="event-task-form" method="post">
                                        <div class="form-group">
                                            <label for="task-desc" class="control-label">Task</label>
                                            <div class="form-inline">
                                                <textarea class="form-control task-desc" name="task_desc" style="max-width: 100%">
                                                </textarea>
                                            </div>
                                        </div>
                                        <div class="task-date-time">
                                            <div class="col-md-12">
                                                <label>Date and Time: </label>
                                            </div>
                                            <div class="form-inline">
                                                <div class="col-md-5">
                                                    <input type="text" class="form-control task-date" name="task_date" placeholder="yyyy-dd-mm">
                                                </div>
                                                <div class="task-time">
                                                    <div class="form-group col-md-3">
                                                        <select class="form-control task-hr required select" name="task_hr">
                                                            <option class="default-hr" value="">Hour</option>
                                                            <?php $task_hr = 1; while($task_hr!=25){  ?>
                                                                <?php if(strlen($task_hr)==1) { ?>
                                                                    <option value="0<?php echo $task_hr?>">0<?php echo $task_hr?></option>
                                                                <?php }else{ ?>
                                                                    <option value="<?php echo $task_hr?>"><?php echo $task_hr?></option>
                                                                <?php } ?>
                                                            <?php $task_hr++; }?>
                                                        </select>
                                                    </div>
                                                    <div class="col-md-1 text-center">
                                                        <label>:</label>
                                                    </div>
                                                    <div class="form-group col-md-3">
                                                        <select class="form-control task-min required select" name="task_min">
                                                            <option class="default-min" value="">Minute</option>
                                                            <?php $task_min = 1; while($task_min!=60){  ?>
                                                                <?php if(strlen($task_min)==1) { ?>
                                                                    <option value="0<?php echo $task_min?>">0<?php echo $task_min?></option>
                                                                <?php }else{ ?>
                                                                    <option value="<?php echo $task_min?>"><?php echo $task_min?></option>
                                                                <?php } ?>
                                                            <?php $task_min++; }?>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="pull-right margin-top">
                                            <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                            <input type="submit" class="btn btn-primary btn-add" value="Add"/>
                                        </div>
                                        <div class="clearfix"></div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <?php }else{ ?>
            <?php } ?>
        </div>
    </div>
</div>
